package com.swy.api;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @Author:XJP
 * @时间: 2018/10/17
 * @描述:
 */
@RestController
public class UserController {

    /**
     * 获取当前登录用户信息
     * @param user
     * @return
     */
    @GetMapping("/userinfo")
    public Principal user(Principal user) {
        return user;
    }

}
